package com.mallcloud.mall.admin.api.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.mallcloud.mall.common.core.model.BaseModel;
import com.mallcloud.mall.common.core.sensitive.Sensitive;
import com.mallcloud.mall.common.core.util.ValidGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

@ApiModel(value = "SysSocialDetails", description = "第三方账号信息")
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "sys_social_details", autoResultMap = true)
public class SysSocialDetails extends BaseModel {
	private static final long serialVersionUID = 1L;

	@NotNull(message = "id为空", groups = {ValidGroup.Update.class})
	@TableId(type = IdType.ASSIGN_ID)
	@ApiModelProperty(value = "主键")
	private Long id;

	@NotBlank(message = "类型不能为空")
	@ApiModelProperty(value = "账号类型")
	private String type;

	@ApiModelProperty(value = "描述")
	private String remark;

	@Sensitive(prefixNoMaskLen = 4, suffixNoMaskLen = 4)
	@NotBlank(message = "账号不能为空")
	@ApiModelProperty(value = "appId")
	private String appId;

	@Sensitive(prefixNoMaskLen = 9, suffixNoMaskLen = 9)
	@NotBlank(message = "密钥不能为空", groups = {ValidGroup.Insert.class})
	@ApiModelProperty(value = "app secret")
	private String appSecret;

	@ApiModelProperty(value = "回调地址")
	private String redirectUrl;

	@ApiModelProperty(value = "拓展字段")
	private String ext;

}
